﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Docking="clr-namespace:Monti.Docking">

   <BooleanToVisibilityConverter x:Key="boolConverter"/>
   <Docking:TabStripPlacementColumnConverter x:Key="colConverter" />
   <Docking:TabStripPlacementRowConverter x:Key="rowConverter" />
   <Docking:DockSiteBorderConverter x:Key="dockBorderConverter" />
   
   <SolidColorBrush x:Key="MetroBaseBackground" Color="#EBEBEB"/>
   <SolidColorBrush x:Key="MetroHighlightBackground" Color="#D8D8D9"/>
   <SolidColorBrush x:Key="MetroSelectedBackground" Color="#3A87AD"/>
   <SolidColorBrush x:Key="MetroSelectedText" Color="White"/>
   <SolidColorBrush x:Key="MetroDisabledText" Color="#858585"/>
   
   <Style TargetType="ToggleButton"
          x:Key="MetroToggleButton">
      <Setter Property="Template">
         <Setter.Value>
            <ControlTemplate TargetType="ToggleButton">
               <Border BorderThickness="1"
                       x:Name="PART_Border"
                       BorderBrush="{StaticResource MetroHighlightBackground}"
                       Background="{StaticResource MetroBaseBackground}">
                  <Grid Margin="4">
                     <ContentPresenter x:Name="ButtonContentPresenter"
                                VerticalAlignment="Center"
                                HorizontalAlignment="Center"/>
                  </Grid>
               </Border>
            
               <ControlTemplate.Triggers>
                  <Trigger Property="IsMouseOver" Value="True">
                     <Setter Property="Background"
                             TargetName="PART_Border"
                             Value="{StaticResource MetroHighlightBackground}" />
                  </Trigger>
                  <Trigger Property="IsChecked" Value="True">
                     <Setter Property="Background"
                             TargetName="PART_Border"
                             Value="{StaticResource MetroSelectedBackground}" />
                     <Setter Property="Foreground"
                             Value="{StaticResource MetroSelectedText}" />
                  </Trigger>
               </ControlTemplate.Triggers>
            </ControlTemplate>
         </Setter.Value>
      </Setter>
   </Style>

   <Color x:Key="BorderColor_Base">#888</Color>
   <Color x:Key="TabControl_BackgroundColor_Base">#EEF7FF</Color>
   <Color x:Key="LineButtonBackgroundColor_Bright">LightGoldenrodYellow</Color>
   <Color x:Key="LineButtonBackgroundColor_Dark">#FAEEB1</Color>
   <Color x:Key="LineButtonBackgroundColorDisabled_Bright">#EEE</Color>
   <Color x:Key="LineButtonBackgroundColorDisabled_Dark">#999</Color>
   <Color x:Key="TabItem_ForegroundColor_Base">#4971A3</Color>

   <SolidColorBrush x:Key="TabBorderBrush" Color="LightGray"/>
   <SolidColorBrush x:Key="TabGrayTextBrush" Color="#FF444444"/>
   <SolidColorBrush x:Key="TabCloseButtonBrush" Color="#FFADADAD"/>
   <SolidColorBrush x:Key="TabItemNormalBackground" Color="WhiteSmoke"/>
   <SolidColorBrush x:Key="TabItemHoverBackground" Color="LightGray"/>
   <SolidColorBrush x:Key="TabItemSelectedBackground" Color="LightGray"/>
   <SolidColorBrush x:Key="TabItemCloseButtonNormalForegroundBrush" Color="{StaticResource TabItem_ForegroundColor_Base}"/>
   <SolidColorBrush x:Key="TabItemCloseButtonHoverForegroundBrush" Color="White"/>
   <SolidColorBrush x:Key="TabItemCloseButtonPressedForegroundBrush" Color="#EEEE"/>

   <SolidColorBrush x:Key="TabControl_BackgroundBrush_Base" Color="#FFFFD33A"/>
   <SolidColorBrush x:Key="TabPage_InnerBorderBrushDark" Color="#FF8DB2E3"/>
   <SolidColorBrush x:Key="LineButtonBorderBrush" Color="#FF8693BD"/>
   <SolidColorBrush x:Key="LineButtonBrush" Color="#FF14273D"/>
   <SolidColorBrush x:Key="TabItem_BorderBrush_Selected" Color="{StaticResource BorderColor_Base}"/>
   <SolidColorBrush x:Key="TabItem_TextBrush_Unselected" Color="{StaticResource TabItem_ForegroundColor_Base}" />
   <SolidColorBrush x:Key="TabItem_TextBrush_Disabled" Color="#888" />
   <SolidColorBrush x:Key="TabItem_TextBrush_Hover" Color="#2D2C8A" />
   <SolidColorBrush x:Key="TabItem_TextBrush_Selected" Color="#0D3288" />

   <LinearGradientBrush x:Key="TabPage_InnerBorderBrushBright" StartPoint="0,0" EndPoint="1,1">
      <LinearGradientBrush.GradientStops>
         <GradientStop Offset="0" Color="Transparent"/>
         <GradientStop Offset="1" Color="#FFC0F9FF"/>
      </LinearGradientBrush.GradientStops>
   </LinearGradientBrush>
   
   <LinearGradientBrush x:Key="LineButtonHoverBrush" StartPoint="0.5,0" EndPoint="0.5,1">
      <GradientStop Color="#FFFFD5A0" Offset="0.3"/>
      <GradientStop Color="#FFFFA335" Offset="0.51"/>
      <GradientStop Color="#FFFFC14A" Offset="0.986"/>
   </LinearGradientBrush>

   <LinearGradientBrush x:Key="TabItemMenuBackcolor" StartPoint="0,0" EndPoint="1,1">
      <GradientStop Offset="0" Color="White"/>
      <GradientStop Offset="1" Color="#EEE"/>
   </LinearGradientBrush>

   <LinearGradientBrush x:Key="TabMenuButtonBrush" StartPoint="0,0" EndPoint="1,1">
      <GradientStop Offset="0" Color="White"/>
      <GradientStop Offset="1" Color="#F3F3E3"/>
   </LinearGradientBrush>
   
   <LinearGradientBrush x:Key="LineButtonBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
      <GradientStop Offset="0.3" Color="{StaticResource LineButtonBackgroundColor_Bright}"/>
      <GradientStop Offset="0.4" Color="{StaticResource LineButtonBackgroundColor_Dark}"/>
      <GradientStop Offset="1" Color="{StaticResource LineButtonBackgroundColor_Bright}"/>
   </LinearGradientBrush>


   <LinearGradientBrush x:Key="TabItem_DisabledBorderBrush" StartPoint="0,0" EndPoint="0,1">
      <GradientStop Color="#CCC" Offset="0"/>
      <GradientStop Color="{StaticResource BorderColor_Base}" Offset="0.8"/>
   </LinearGradientBrush>
   
   <LinearGradientBrush x:Key="TabItem_Border_Unselected" StartPoint="0,0" EndPoint="0,1">
      <GradientStop Color="#AAA" Offset="0"/>
      <GradientStop Color="{StaticResource BorderColor_Base}" Offset="0.8"/>
   </LinearGradientBrush>
   
   <LinearGradientBrush x:Key="TabItem_HoverBorderBrush" StartPoint="0,0" EndPoint="0,1">
      <LinearGradientBrush.GradientStops>
         <GradientStop Offset="0.98" Color="DarkOrange"/>
         <GradientStop Offset="0.99" Color="{StaticResource BorderColor_Base}"/>
      </LinearGradientBrush.GradientStops>
   </LinearGradientBrush>

   <LinearGradientBrush x:Key="TabItem_BackgroundBrush_Selected"
                        StartPoint="0,0"
                        EndPoint="0,1">
      <LinearGradientBrush.GradientStops>
         <GradientStop Color="#FFFFD33A"
                       Offset="0.3" />
         <GradientStop Color="#FFFFE27B"
                       Offset="0.7" />
         <GradientStop Color="#FFFFEA9E"
                       Offset="0.9" />
         <GradientStop Color="#FFFFC14A"
                       Offset="1.0" />
      </LinearGradientBrush.GradientStops>
   </LinearGradientBrush>

   <LinearGradientBrush x:Key="TabItem_BackgroundBrush_Unselected" StartPoint="0,0" EndPoint="0,1">
      <LinearGradientBrush.GradientStops>
         <GradientStop Color="#E8F2FF" Offset="0.0"/>
         <GradientStop Color="#DFE9F6" Offset="0.3"/>
         <GradientStop Color="#C7D8EE" Offset="0.7"/>
         <GradientStop Color="#B9CADE" Offset="0.98"/>
         <GradientStop Color="{StaticResource BorderColor_Base}" Offset="0.99"/>
      </LinearGradientBrush.GradientStops>
   </LinearGradientBrush>

   <LinearGradientBrush x:Key="TabItem_BackgroundBrush_Disabled" StartPoint="0,0" EndPoint="0,1">
      <LinearGradientBrush.GradientStops>
         <GradientStop Color="#EEE" Offset="0"/>
         <GradientStop Color="#BBB" Offset="0.98"/>
         <GradientStop Color="{StaticResource BorderColor_Base}" Offset="0.99"/>
      </LinearGradientBrush.GradientStops>
   </LinearGradientBrush>
   
   <LinearGradientBrush x:Key="TabItem_HoverBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
      <GradientStop Color="#FFFFD5A0" Offset="0.3" />
      <GradientStop Color="#FFFFA335" Offset="0.51" />
      <GradientStop Color="#FFFFC14A" Offset="0.98" />
   </LinearGradientBrush>

   <LinearGradientBrush x:Key="TabItemCloseButtonNormalBackgroundBrush" 
                           StartPoint="0,0" EndPoint="1,0">
      <GradientBrush.GradientStops>
         <GradientStopCollection>
            <GradientStop Color="#5FFF" Offset="0.0"/>
            <GradientStop Color="#5CCC" Offset="1.0"/>
         </GradientStopCollection>
      </GradientBrush.GradientStops>
   </LinearGradientBrush>

   <LinearGradientBrush x:Key="TabItemCloseButtonNormalBorderBrush" StartPoint="0,0" EndPoint="1,1">
      <GradientBrush.GradientStops>
         <GradientStopCollection>
            <GradientStop Color="#5CCC" Offset="0.0"/>
            <GradientStop Color="#5444" Offset="1.0"/>
         </GradientStopCollection>
      </GradientBrush.GradientStops>
   </LinearGradientBrush>

   <LinearGradientBrush x:Key="TabItemCloseButtonHoverBackgroundBrush" StartPoint="0,1" EndPoint="1,0">
      <GradientBrush.GradientStops>
         <GradientStopCollection>
            <GradientStop Color="#FFDF2B1E" Offset="0.0"/>
            <GradientStop Color="#FFA41F00" Offset="1.0"/>
         </GradientStopCollection>
      </GradientBrush.GradientStops>
   </LinearGradientBrush>

   <LinearGradientBrush x:Key="TabItemCloseButtonPressedBackgroundBrush" StartPoint="0,0" EndPoint="1,1">
      <GradientBrush.GradientStops>
         <GradientStopCollection>
            <GradientStop Color="#FFA41F00" Offset="0.0"/>
            <GradientStop Color="#FFDF2B1E" Offset="1.0"/>
         </GradientStopCollection>
      </GradientBrush.GradientStops>
   </LinearGradientBrush>

   <LinearGradientBrush x:Key="TabItemCloseButtonPressedBorderBrush" StartPoint="0,0" EndPoint="1,1">
      <GradientBrush.GradientStops>
         <GradientStopCollection>
            <GradientStop Color="#5444" Offset="0.0"/>
            <GradientStop Color="#5CCC" Offset="1.0"/>
         </GradientStopCollection>
      </GradientBrush.GradientStops>
   </LinearGradientBrush>

   <Geometry x:Key="TabMenuButton">M0,1 H0,5 M7,8 L0,8 0,2 10,2 L10,5 M10,8 L10,10 8,10Z</Geometry>
   <Geometry x:Key="X_CloseButton">M0,0 L10,10 M0,10 L10,0</Geometry>
   <Geometry x:Key="PinButton">M3,10 L3,7 M0,6 L6,6 M1,6 L1,0 L5,0 L5,5 M5,5 L5,1</Geometry>
   <Geometry x:Key="PinnedButton">M0,0 L10,10 M0,10 L10,0</Geometry>

   <Style x:Key="TabMenuPath" TargetType="{x:Type Path}">
      <Setter Property="Stretch" Value="Fill"/>
      <Setter Property="Margin" Value="2"/>
      <Setter Property="Data" Value="{StaticResource TabMenuButton}" />
      <Setter Property="Fill" Value="{StaticResource TabMenuButtonBrush}"/>
      <Setter Property="Stroke" Value="{StaticResource LineButtonBrush}"/>
      <Setter Property="VerticalAlignment" Value="Center"/>
      <Setter Property="HorizontalAlignment" Value="Center"/>
   </Style>

   <Style x:Key="PinButtonStyle"
          TargetType="{x:Type Button}">
      <Setter Property="SnapsToDevicePixels"
              Value="false" />
      <Setter Property="Height"
              Value="14" />
      <Setter Property="Width"
              Value="14" />
      <Setter Property="Cursor"
              Value="Hand" />
      <Setter Property="Focusable"
              Value="False" />
      <Setter Property="OverridesDefaultStyle"
              Value="true" />
      <Setter Property="Template">
         <Setter.Value>
            <ControlTemplate TargetType="{x:Type Button}">
               <Border x:Name="ButtonBorder"
                       CornerRadius="2"
                       BorderThickness="1"
                       Background="{StaticResource TabItemCloseButtonNormalBackgroundBrush}"
                       BorderBrush="{StaticResource TabItemCloseButtonNormalBorderBrush}">
                  <Grid>
                     <Path x:Name="ButtonPath"
                           Margin="2"
                           Data="{StaticResource PinButton}"
                           Stroke="{StaticResource TabItemCloseButtonNormalForegroundBrush}"
                           StrokeThickness="2"
                           StrokeStartLineCap="Round"
                           StrokeEndLineCap="Round"
                           Stretch="Uniform"
                           VerticalAlignment="Center"
                           HorizontalAlignment="Center" />
                     <ContentPresenter HorizontalAlignment="Center"
                                       VerticalAlignment="Center" />
                  </Grid>
               </Border>
            </ControlTemplate>
         </Setter.Value>
      </Setter>
   </Style>

   <Style x:Key="TabItemCloseButtonStyle"
          TargetType="{x:Type Button}">
      <Setter Property="SnapsToDevicePixels"
              Value="false" />
      <Setter Property="Height"
              Value="14" />
      <Setter Property="Width"
              Value="14" />
      <Setter Property="Cursor"
              Value="Hand" />
      <Setter Property="Focusable"
              Value="False" />
      <Setter Property="OverridesDefaultStyle"
              Value="true" />
      <Setter Property="Template">
         <Setter.Value>
            <ControlTemplate TargetType="{x:Type Button}">
               <Border x:Name="ButtonBorder"
                       CornerRadius="2"
                       BorderThickness="1"
                       Background="{StaticResource TabItemCloseButtonNormalBackgroundBrush}"
                       BorderBrush="{StaticResource TabItemCloseButtonNormalBorderBrush}">
                  <Grid>
                     <Path x:Name="ButtonPath"
                           Margin="2"
                           Data="{StaticResource X_CloseButton}"
                           Stroke="{StaticResource TabItemCloseButtonNormalForegroundBrush}"
                           StrokeThickness="2"
                           StrokeStartLineCap="Round"
                           StrokeEndLineCap="Round"
                           Stretch="Uniform"
                           VerticalAlignment="Center"
                           HorizontalAlignment="Center" />
                     <ContentPresenter HorizontalAlignment="Center"
                                       VerticalAlignment="Center" />
                  </Grid>
               </Border>
               <ControlTemplate.Triggers>
                  <Trigger Property="IsMouseOver"
                           Value="True">
                     <Setter TargetName="ButtonBorder"
                             Property="Background"
                             Value="{StaticResource TabItemCloseButtonHoverBackgroundBrush}" />
                     <Setter TargetName="ButtonPath"
                             Property="Stroke"
                             Value="{StaticResource TabItemCloseButtonHoverForegroundBrush}" />
                  </Trigger>
                  <Trigger Property="IsEnabled"
                           Value="false">
                     <Setter Property="Visibility"
                             Value="Collapsed" />
                  </Trigger>
                  <Trigger Property="IsPressed"
                           Value="true">
                     <Setter TargetName="ButtonBorder"
                             Property="Background"
                             Value="{StaticResource TabItemCloseButtonPressedBackgroundBrush}" />
                     <Setter TargetName="ButtonBorder"
                             Property="BorderBrush"
                             Value="{StaticResource TabItemCloseButtonPressedBorderBrush}" />
                     <Setter TargetName="ButtonPath"
                             Property="Stroke"
                             Value="{StaticResource TabItemCloseButtonPressedForegroundBrush}" />
                     <Setter TargetName="ButtonPath"
                             Property="Margin"
                             Value="2.5,2.5,1.5,1.5" />
                  </Trigger>
               </ControlTemplate.Triggers>
            </ControlTemplate>
         </Setter.Value>
      </Setter>
   </Style>

</ResourceDictionary>